﻿/* Copyright 2008 dnAnalytics Project.
 *
 * Contributors to this file:
 * Marcus Cuda
 *
 * This file is part of dnAnalytics.  dnAnalytics is licensed under the 
 * Microsoft Public License. See License.txt for a complete copy of the
 * license.
 */

namespace dnAnalytics.Statistics.Distributions
{
    /// <summary>
    /// A discrete distribution that can be sampled.
    /// </summary>
    public interface IDiscreteDistribution : IDistribution
    {
        /// <summary>
        /// The mode of the distribution.
        /// </summary>
        int Mode { get; }

        /// <summary>
        /// The median of the distribution.
        /// </summary>
        int Median { get; }

        /// <summary>
        /// Computes values of the probability mass function.
        /// </summary>
        /// <param name="k">The location in the domain where we want to evaluate the probability mass function.</param>
        double Probability(int k);

        /// <summary>
        /// Samples draws a random sample for the distribution.
        /// </summary>
        /// <returns>A random number from the distribution.</returns>
        int Sample();

        /// <summary>
        /// Samples draws a random sample for the distribution.
        /// </summary>
        /// <param name="size">The size of the sample.</param>
        /// <returns>An array of random numbers from the distribution.</returns>
        int[] Sample(int size);
    }
}